var bej=[
    'http://m.ostcn.com/static/img/course-ab.786ed16.png',
    'http://m.ostcn.com/static/img/course-star.324ce5b.png',
    'http://m.ostcn.com/static/img/course-ab.786ed16.png',
    'http://m.ostcn.com/static/img/course-star.324ce5b.png',
];
var abkechen = document.querySelector('.kechen2');
var kecheng = new XMLHttpRequest();
kecheng.open('get','http://47.116.75.38:8101/front/getCourseCls')
kecheng.send(null)
kecheng.onload = function()
{
    var kecheng1=JSON.parse(kecheng.response).data
    kecheng1.forEach(function (item,index) {
        var div=document.createElement('div');
        div.classList.add('ABkechen')
        var a=document.createElement('a')
        a.className='kkffs'
        a.href='../href/allkechen.html'
        div.style.backgroundImage="url("+bej[index]+")";
        div.innerText = item.dictLabel
        div.style.width=(font.offsetWidth/2) + 'px'
        a.appendChild(div)
        abkechen.appendChild(a)
        // console.log(item.dictLabel)
    })
}
abkechen.style.setProperty('--duoge',bej.length+1)
console.log(abkechen)